(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('apf.l.assetrepayment.viewController', viewController);
	viewController.$inject = [ '$scope', '$q', 'Constants', 'gridService', 'modalService', 'layoutConfig', 'validatorConfig', 'authService',
			'assetrepaymentService' ];
	function viewController($scope, $q, Constants, gridService, modalService, layoutConfig, validatorConfig, authService, assetrepaymentService) {
		var ctrl = this, 
			log = $scope.loggerFactory.getLogger("assetrepaymentViewController"),
			errorMessage = {}, 
			params = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		ctrl.assetrepayment = {};
		
		ctrl.init = function() {
			assetrepaymentService.getAssetrepaymentViewOptions().then(function(data){
				ctrl.assetRepaymentStatusOptions = data.assetrepaymentStatus;
				authService.view(params).then(function(response) {
					if (response.data) {
						ctrl.assetrepayment = response.data;
					}
				});
			});
		};
	}
})(angular);
